import threading
from communication import *

class Uploader(threading.Thread):
  def __init__(self, ip, port, fname, pman):
    threading.Thread.__init__(self)
    self._ip = ip
    self._port = port
    self._fname = fname
    self._pman = pman
    
  def run(self):
    file = open(self._fname, "r")
    data = file.read()
    
    comm(self._ip, self._port, self._pman.name, FILE, (self._fname, data))